#include "stdafx.h"
#include "sock_callback_filter.h"

CSockCallbackFilter::CSockCallbackFilter(void)
: m_pcallback(NULL)
{
}

CSockCallbackFilter::~CSockCallbackFilter(void)
{
}


void CSockCallbackFilter::Init(ISock_cb_event* pcallback)
{
	m_pcallback = pcallback;
}

void CSockCallbackFilter::OnBinded(ISocketConn* pConn)
{
	if(m_pcallback)
		m_pcallback->OnBinded(pConn);
}
void CSockCallbackFilter::OnAccepted(ISocketConn* pConn, unsigned short nListenPort)
{
	if(m_pcallback)
		m_pcallback->OnAccepted(pConn, nListenPort);
}
void CSockCallbackFilter::OnConnected(ISocketConn* pConn, int nError)
{
	if(m_pcallback)
		m_pcallback->OnConnected(pConn, nError);
}
void CSockCallbackFilter::OnRead(ISocketConn* pConn)
{
	if(m_pcallback)
		m_pcallback->OnRead(pConn);
}
void CSockCallbackFilter::OnWrite(ISocketConn* pConn)
{
	if(m_pcallback)
		m_pcallback->OnWrite(pConn);
}
void CSockCallbackFilter::OnRelease(ISocketConn* pConn, bool bActive, int nError)
{
	if(m_pcallback)
		m_pcallback->OnRelease(pConn, bActive, nError);
}
void CSockCallbackFilter::OnTimer(ISocketConn* pConn, int timer_id)
{
	if(m_pcallback)
		m_pcallback->OnTimer(pConn, timer_id);
}
void CSockCallbackFilter::OnThreadMsg(unsigned int nMsg, void* param1, void* param2)
{
	if(m_pcallback)
		m_pcallback->OnThreadMsg(nMsg, param1, param2);
}




